package com.itheima01;

import java.util.ArrayList;
import java.util.Scanner;

public class ScannerStudent {
    public static void main(String[] args) {
        ArrayList<Student> list = new ArrayList<>();

        getInfo(list);

        System.out.println(list);
    }

    public static void getInfo(ArrayList<Student> list){
        Scanner sc = new Scanner(System.in);

        System.out.println("请输入你的名字:");
        String name = sc.next();
        System.out.println("请输入你的年龄:");
        int age = sc.nextInt();
        System.out.println("请输入你的性别:");
        String sex = sc.next();


        //创建学生对象
        Student s = new Student(name,sex,age);

        list.add(s);
    }
}
